import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:search_people/utils/img_util.dart';

import 'index.dart';

class SplashPage extends StatelessWidget {
  SplashPage({Key? key}) : super(key: key);
  final controller = Get.put(SplashLogic());

  @override
  Widget build(BuildContext context) {
    return GetBuilder<SplashLogic>(
      builder: (_) {
        return Scaffold(
          body: Stack(
            children: [
              Image.network(
                  'https://pics2.baidu.com/feed/5fdf8db1cb134954cc073ab0060f3653d0094a92.jpeg@f_auto?token=a3d9d0e364c96d4644cf5e4a11d92a7c',
                  width: 10,
                  height: 10),
              SizedBox(
                height: 1.sh,
                width: 1.sw,
              ),
              Positioned(
                  top: 159.r,
                  width: 1.sw,
                  child: Column(
                    children: [
                      Image.asset(
                        'assets/images/appIcon.png',
                        height: 120.r,
                        width: 120.r,
                        fit: BoxFit.cover,
                      ),
                      SizedBox(
                        height: 15.r,
                      ),
                      Text(
                        controller.state.appName,
                        style: TextStyle(
                          color: Colors.black,
                          fontSize: 23.sp,
                        ),
                      ),
                    ],
                  )),
              Positioned(
                right: 20.r,
                child: SafeArea(
                  child: InkWell(
                    onTap: controller.toMain,
                    child: Container(
                      width: 40.r,
                      height: 40.r,
                      alignment: Alignment.center,
                      decoration: BoxDecoration(
                          color: Colors.grey[350],
                          borderRadius: BorderRadius.circular(20.r)),
                      child: Text(
                        controller.state.seconds.toString(),
                        style: TextStyle(color: Colors.white, fontSize: 13.sp),
                      ),
                    ),
                  ),
                ),
              ),
            ],
          ),
        );
      },
    );
  }
}
